Recently, multiprocessor systems each performing multiple processes that operate a plurality of processes in a parallel manner are provided. In a multiprocessor system that performs multiple processes, there are cases where a shared memory system is used in which each process uses a memory in the same range.
In such a multiprocessor system using a shared memory, there is concern that the content of the memory may be destroyed due to unauthorized use of the memory that is made by each process. Thus, several methods for preventing the destruction of a memory due to unauthorized use of the memory are proposed. Conventional methods of preventing unauthorized use of a memory are largely divided into a protection method using software and a protection method using hardware.
The protection using software prevents unauthorized use of a memory by using not only a pointer but also a key as a set in a case where the memory is referred to. For example, when a memory is to be secured like in the case of malloc, an integer value that becomes a key together with a pointer of a memory area is generated, and the memory is prevented from being accessed without using the pointer together with a correct key as a set. In addition, the protection method using hardware is realized by adding a memory protection function to a memory management unit (MMU) of the hardware.
In addition, as a method of controlling the access to a memory, there is a conventional technique in which an accessible area of the memory is restricted using a base register and an upper-limit register for each virtual counting machine. In addition, in recent years, in order to respond to an error in a memory, error check and correct (ECC) memories are provided to which an ECC function for detecting and correcting errors is added. As a conventional technique for such an ECC memory, there is a technique for freely writing an ECC code into the ECC memory.
Patent Literature 1: Japanese Laid-open Patent Publication No. 61-26152
Patent Literature 2: Japanese Examined Patent Application Publication No. 62-22199
However, according to a conventional protection method using software, a process of collating a key is performed by software for each memory access, and accordingly, the overhead due to the process increases, whereby the processing speed of the information processing apparatus decreases.
In addition, the process of the MMU is performed in units of pages each having a large size, for example, several kilobytes to several megabytes. Thus, according to a conventional protection method using hardware, the protection of a memory is performed also in units of pages, and accordingly the granularity is much rougher than the unit of memories that are managed by software, whereby it is difficult to perform memory protection that is appropriate to software.